package com.pp.controller;

import com.pp.common.vo.SysResult;
import com.pp.service.LocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/api/location")
public class LocationController {
    @Autowired
    private LocationService locationService;
    /**
     * 基于用户id查询地址信息
     * @return
     */
    @RequestMapping("/{id}")
    public SysResult selectUserAddress(@PathVariable Integer id){
        String address = locationService.selectUserAddress(id);
        System.out.println(address);
        return SysResult.success(address);

    }
}
